home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-04-27 | 1.6 KB | 51 lines | [TEXT/GEOL] |
- Item forwarded by A33 to A34
-
- Item 5412635 24-April-90 22:53DST
-
- From: UK0392 EHN & DIJ Oakley,IDV
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: Changing cursors
-
- Friends,
-
- In the course of implementing my scalable views stuff, I wanted to change the
- cursor (e.g. to a magnifying glass) when the user presses just (repeat JUST)
- the Option key, so that with said key pressed, a mouse click will fire off a
- ZoomCommand object.
-
- This has transpired to be rather messy, and I wonder if anyone can suggest a
- neater way of doing it.
-
- Because holding JUST the option key down does not generate an event (tut,
- tut!), I have had to insert this little bit into MyApplication.GetEvent:
-
- GetEvent := INHERITED GetEvent(eventMask, sleep, cursorRgn, anEvent);
- GetKeys(aKeyMap);
- IF (aKeyMap[$3A]) THEN gZoomingCmd := cZoomSpotIn {…}
-
- which sets a global which the view's DoSetCursor uses to change cursors with.
-
- However, unless the mouse is moved OFF the view and back on again, DoSetCursor
- is not called. So what I have had to kludge is:
-
- gDocList.Each(CheckCurs);
-
- in my GetEvent, calling:
-
- PROCEDURE CheckCurs(aDocument: TDocument);
- BEGIN
- IF (TPanlDocument(aDocument).fPanlGWindow = GetFrontWindow) THEN
- {try to save a bit of time here by just going for the front window}
- IF TPanlDocument(aDocument).fPanlGView.DoSetCursor(aPt, aCR) THEN ;
- END;
-
- This of course carries a not insignificant overhead, and results in loss of
- MacApp's lovely cursor setting mechanism.
-
- Suggestions would be *most* welcome, please.
-
- Howard.
-
-